﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web.Views.AgentManager
{
    public partial class OrderSelect : System.Web.UI.Page
    {
        public int OrderID = 0;
        public int UserID = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["OrderID"] != null)
            {
                OrderID = Convert.ToInt32(Request.QueryString["OrderID"].ToString());
            }
            if (Request.QueryString["UserID"] != null)
            {
                UserID = Convert.ToInt32(Request.QueryString["UserID"].ToString());
            }
            if (!IsPostBack)
            {
                SelectOrder(OrderID);
            }
        }
       
        public void SelectOrder(int OrderID)
        {
            Easydp.Models.Entities.TT_Orders model = new Easydp.Models.Entities.TT_Orders();
            Easydp.Controllers.OrderController bll = new Easydp.Controllers.OrderController();
            model = bll.getmodel(" OrderID="+OrderID+"");
            LabAmount.Text = model.Amount.ToString();
            LabCreateDate.Text = model.CreateOn.ToString();
            LabEnd.Text = model.EndStation.ToString();
            LabIsCHD.Text = model.IsCHD.ToString()=="False"?"否":"是";
            labOrderNum.Text = model.OrderNum.ToString();
            LabPew.Text = model.Pew.ToString();
            LabPhotoAuthCode.Text = model.PhotoAuthCode.ToString();
            LabStart.Text = model.StartStation.ToString();
            LabState.Text = model.OrderState.ToString();
            LabTrainNumber.Text = model.TrainNumber.ToString();
            LabUnitPrice.Text = model.UnitPrice.ToString();
            LabUserName.Text = model.UserName.ToString();
            LabUserTelphone.Text = model.UserTelphone.ToString();
            labRemark.Text = model.Remark.ToString();


            Easydp.Models.Entities.TT_PushFee PushFee = new Easydp.Models.Entities.TT_PushFee();
            Easydp.Controllers.PushFeeController BLLpushfee = new Easydp.Controllers.PushFeeController();

            try
            {
                PushFee = BLLpushfee.GetModel(OrderID);

                LabAgentGet.Text = PushFee.AgentGet.ToString();
                LabAgentAccount.Text = PushFee.AgentAccount.ToString();
                LaCreateOn.Text = PushFee.CreateOn.ToShortDateString();
            }
            catch (Exception ex)
            {
                Label1.Text = ex.ToString();
            }

           
          


        }

    }
}
